<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- 引入核心模块 -->
  <script src="../react18/react.development.js"></script>
  <!-- 引入ReactDOM对象 -->
  <script src="../react18/react-dom.development.js"></script>
  <!-- 引入babel  把JSX编译成JS语言 -->
  <script src="../react18/babel.min.js"></script>
</head>
<body>
  <!-- 虚拟DOM容器 -->
  <div id="app"></div>

  <script type="text/babel" >


//假设请求回来我们要学习的课程数据   渲染到页面
    /* 
      思路:
        首先想到遍历,遍历生成li,有几条数据生成几个li 标签
    */


const course = ["html","css","js","react","node"];

const vDOM=(
  <ul>
    {
      course.map((item,index)=>{
       return <li>{item}</li>
      })
    }
    </ul>
)

// 创建根节点渲染页面
    ReactDOM.createRoot(document.getElementById("app")).render(vDOM)


  </script>
  
</body>
</html>